/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.sql.SQLOutput;

/**
 * <p>Project: jse2302 - T7
 * <p>Powered by webrx On 2023-06-30 10:51:51
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T7 {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName());
        System.out.println(Thread.currentThread().getPriority());

        Runnable run = ()->{
            String t = Thread.currentThread().getName();
            System.out.println(t);
        };

        var t1 = new Thread(run); //默认线程名称为Thread-0
        t1.setName("B");
        System.out.println(t1.getPriority());
        t1.start();


        var t2 = new Thread(run,"A");//线程名称为A
        t2.setPriority(Thread.MAX_PRIORITY);
        System.out.println(t2.getPriority());
        t2.start();

    }
}
